 <meta charset="utf-8">
<?php
include_once('dbConn.php');
 //连接数据库  
  	connect();
	$cid = $_POST['cid'];
	$content = $_POST['content'];
	//更新数据库相应信息
//编写SQL语句
    $sql = "update comments set content='{$content}',cdate=now() where cid={$cid}";			  //执行SQL语句
   $result = mysql_query($sql) or die("sql={$sql}, 更新失败！<br/>".mysql_error());
  //判断是否更新成功
  $num = mysql_affected_rows();
  if($num!=1){
		echo "更新失败,2秒后返回留言列表~<br/>";
		 
		header("refresh:2;url='mycommentList.php'"); 
  }else{		
   echo "更新成功,2秒后返回留言列表~<br/>";
		 
		header("refresh:2;url='mycommentList.php'");   }	
?>
